import Layout from '@/layout';

const formRoute = [
  {
    path: '/repairs-form',
    redirect: '/form/repairs-form',
    meta: { title: '耗材库存预警' },
    component: Layout,
    children: [
      {
        path: '/repairs-form',
        name: 'repairs-form',
        component: () => import('@/views/form/repairs-form'),
        meta: { title: '报修数据' },
        props: route => ({
          $edit: route.query.edit,
          $type: route.query.type
        })
      },
      {
        path: '/transfer-form',
        name: 'transfer-form',
        component: () => import('@/views/form/transfer-form'),
        meta: { title: '转移数据' },
        props: route => ({
          $type: route.query.type
        })
      },
      {
        path: '/return-form',
        name: 'return-form',
        component: () => import('@/views/form/return-form'),
        meta: { title: '退还数据' },
        props: route => ({
          $type: route.query.type
        })
      },
      {
        path: '/loss-form',
        name: 'loss-form',
        component: () => import('@/views/form/loss-form'),
        meta: { title: '报失数据' },
        props: route => ({
          $edit: route.query.edit,
          $type: route.query.type
        })
      },
      {
        path: '/inventory-form',
        name: 'inventory-form',
        component: () => import('@/views/form/inventory-form'),
        meta: { title: '扫码盘点' },
        props: route => ({
          $edit: route.query.edit
        })
      },
      {
        path: '/write-repairs-form',
        name: 'write-repairs-form',
        component: () => import('@/views/form/write-repairs-form'),
        meta: { title: '填写维修记录' },
        props: route => ({
          $edit: route.query.edit
        })
      },
      {
        path: '/repairs-detail-form',
        name: 'repairs-detail-form',
        component: () => import('@/views/form/repairs-detail-form'),
        meta: { title: '报修数据详情' }
      }
    ]
  }
];

export default formRoute;
